openFile

fun PdfDocument.Companion.openFile(path: String, password: ByteArray = byteArrayOf()): PdfDocument

Opens the PDF at path, loading the WHOLE file into memory first (thin sugar over PdfDocument.open; there is no incremental file reader).

Throws

when the file can't be read.

WrongPasswordException

when the document is encrypted and password doesn't authenticate.